using System;
using System.Drawing;

using OpenTK.Graphics.OpenGL;

namespace ColladaDotNet.OpenTKMapping
{
	public class Utils
	{
		public static void DrawOXY(float lengthOXY)
		{


			GL.LineWidth(1);
			GL.Begin(BeginMode.Lines);

			GL.Color3(Color.Red);
			GL.Vertex3(0, 0, 0);
			GL.Vertex3(lengthOXY, 0, 0);

			GL.Color3(Color.Green);
			GL.Vertex3(0, 0, 0);
			GL.Vertex3(0, lengthOXY, 0);

			GL.Color3(Color.Blue);
			GL.Vertex3(0, 0, 0);
			GL.Vertex3(0, 0, lengthOXY);

			GL.End();
		}

		public static void CheckError()
		{
			var e = GL.GetError();
			if (e == ErrorCode.NoError)
				return;
			throw new OpenGLException("OpenGL Error " + e);
		}
	}

	public class OpenGLException : ApplicationException
	{
		public OpenGLException(string s):base(s)
		{
			
		}
	}
}